
package com.thon.commons.utils;

import com.thon.commons.config.Global;

/**
 * 处理图片地址
 * @author manpiaoyi
 *
 */
public class ImageUrl {

	private static String IMG_URL = "";
	
	public static String format(String url) {
		IMG_URL =  Global.getConfig("img.url");
		if (url != null && !url.contains(IMG_URL)) {
			url = IMG_URL + url;
		}

		return url;
	}
	
	public static String format(Integer id) {
		IMG_URL =  Global.getConfig("img.url");
		String url="";
		if (id != null && url != null && !url.contains(IMG_URL)) {
			return url = IMG_URL + id;
		}else {
			return url = IMG_URL + 0;
		}
		
	}
}
